package com.example.samplealarmtest;


import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.support.v4.app.NotificationCompat;

public class BootCompletedReceiver extends BroadcastReceiver {
	
	int mId = 0;

	@Override
	public void onReceive(Context context, Intent intent) {
	    // TODO Auto-generated method stub
		NotificationManager nm = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
		
		NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
		
		builder.setDefaults(Notification.DEFAULT_VIBRATE | Notification.DEFAULT_SOUND | Notification.DEFAULT_LIGHTS);
		builder.setVibrate(new long[] {400,200,300,100});
		builder.setAutoCancel(true);
		builder.setTicker("tickerText");
		builder.setContentInfo("contentinfo");
		builder.setContentText("contenttext");
		builder.setContentTitle("contenttitle");
		builder.setSubText("sub text");
		builder.setNumber(10);
		builder.setWhen(System.currentTimeMillis());
		Bitmap bm = ((BitmapDrawable)context.getResources().getDrawable(R.drawable.gallery_photo_1)).getBitmap();
		builder.setLargeIcon(bm);
//		builder.setProgress(100, 50, false);
		builder.setSmallIcon(R.drawable.ic_launcher);
		builder.setContentIntent(PendingIntent.getActivity(context, 0, new Intent(context, AlarmActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK), 0));
//		builder.setDeleteIntent(PendingIntent.getActivity(MainActivity.this, 0, new Intent(MainActivity.this, MyActivity2.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK), 0));
//		builder.setFullScreenIntent(PendingIntent.getActivity(MainActivity.this, 0, new Intent(MainActivity.this, MyActivity3.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK), 0), false);
		nm.notify(mId++, builder.build());
	}

}
